import request from '@/utils/request'
import { CHECC_API_BASE_DATA } from '@/constants/proxy'
//
//主表
/**
 * 请求路段分页
 *
 * @export
 * @param {*} params
 * @return {*}  {Promise<any>}
 */
export function requestRoadList(params: any, data: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section/page`,
    method: 'post',
    data,
    params,
  })
}
//添加路段信息
export function changeRoadData({ method, data }: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section`,
    method,
    data,
  })
}

//删除路段信息
export function delRoadData(data: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section`,
    method: 'delete',
    data,
  })
}

// 通过id查询
export function queryRoadData(id: any){
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section/${id}`,
    method:'GET',
  })
}
//子表
/**
 * 获取路段互通子表单挑详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
export function getSectionInterchange(data: any, params: any = { pageNum: 1, pageSize: 10 }) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section-interchange/page`,
    method: 'post',
    data,
    params,
  })
}
/**
 * 改变路段互通子表单挑详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
export function changeSectionInterchange(method: any, data: any) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section-interchange`,
    method,
    data,
  })
}
/**
 * 获取参建单位子表单挑详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
export function getSectionBuildUnit(data: any, params: any = { pageNum: 1, pageSize: 10 }) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section-build-unit/page`,
    method: 'post',
    data,
    params,
  })
}
/**
 * 改变参建单位子表单挑详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
export function changeSectionBuildUnit(method: any, data: any) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section-build-unit`,
    method,
    data,
  })
}
/**
 * 获取避险车道子表单挑详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
export function getSectionEscapeLane(data: any, params: any = { pageNum: 1, pageSize: 10 }) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section-escape-lane/page`,
    method: 'post',
    data,
    params,
  })
}
/**
 * 改变避险车道子表单挑详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
export function changeSectionEscapeLane(method: any, data: any) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-fixed-section-escape-lane`,
    method,
    data,
  })
}